package com.hxgis.statisticanalysis.intelligentIndicator.controller;


import com.hxgis.statisticanalysis.intelligentIndicator.service.IntelligentIndicatorService;
import com.hxgis.statisticanalysis.intelligentIndicator.vo.CityNetWorkVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author 赵恒
 * @date 2022/12/16
 */
@Slf4j
@Api(tags = "广西-现代化指标监控")
@RestController
@RequestMapping("/statisticanalysis/frontapi/v1")
public class FailureRecordController {
    @Autowired
    IntelligentIndicatorService intelligentIndicatorService;

//    @ApiOperation("获取详细的网络故障信息（yyyy-MM）")
//    @GetMapping("/getNetWorkMalfunctionDetailsByDate")
    public List<CityNetWorkVO> getNetWorkMalfunctionDetailsByDate(String date) {
        return intelligentIndicatorService.getNetWorkInfo(date);
    }

    @ApiOperation("/获取网络故障时长和次数统计")
    @GetMapping("/getNetworkFailureInfo")
    public Map<String, Object> getNetworkFailureInfo(String startMonth, String endMonth) {
        return intelligentIndicatorService.getNetworkFailureInfo(startMonth, endMonth);
    }
}
